#! /bin/sh

SCRIPT_PATH=`dirname $0`
cd $SCRIPT_PATH

SERVICE_ROOT_PATH=${PWD%/*}
SERVICE_CLASSPATH=$SERVICE_ROOT_PATH:$SERVICE_ROOT_PATH/config

for f in $SERVICE_ROOT_PATH/lib/*.jar; do
  SERVICE_CLASSPATH=$SERVICE_CLASSPATH:$f;
done

export SERVICE_CLASSPATH

JAVA_OPTS='-Xms1024m -Xmx1024m -XX:NewRatio=1 -XX:+UseConcMarkSweepGC -XX:+CMSParallelRemarkEnabled -XX:+UseParNewGC -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+PrintGC -Xloggc:/export/Logs/gc.log -XX:+PrintHeapAtGC'
nohup java -server $JAVA_AGENT $JAVA_OPTS -classpath $SERVICE_CLASSPATH com.alvin.cache.NginxHellApplication >/dev/null 2>&1 &